package ils.services;

import ils.domain.model.User;
import ils.util.SpringUtil;
import ils.util.Util;
import junit.framework.Assert;
import org.junit.Test;

/**
 * Created with IntelliJ IDEA.
 * User: rejeevd
 * Date: 8/10/12
 * Time: 9:03 PM
 * To change this template use File | Settings | File Templates.
 */
public class AdminServiceTest
{
    AdminService adminService = (AdminService) SpringUtil.getApplicationContext().getBean("adminService");

    @Test
    public void testCreateUser()
    {
        User user = new User();
        user.setFirstName(Util.randomString(10));
        user.setLastName(Util.randomString(8));
        user.setEmail(Util.randomString(6) + "@ils.com");
        user.setPasswordHash("5f4dcc3b5aa765d61d8327deb882cf99");
        User user1 = adminService.addUser(user);
        Assert.assertNotNull(user1.getId());
    }
}
